// reducer 用于初始化数据，并且在接受到 action 以后，处理数据改变的逻辑
import { CHANG_TRANSLATION_LIST } from './actions'

const defaultState = {
  translationList: []
}

export default (state = defaultState, action) => {
  switch (action.type) {
    case CHANG_TRANSLATION_LIST:
      return {
        ...state,
        translationList: action.list
      }
    default:
      return state
  }
}
